<?php
session_start();

include_once("../../Misc.php");
include_once("../../classCol/UID.php");
include_once("../../classCol/classOracleDb.php");
include_once("../../helpers/CHtml.php");
include_once("../../helpers/Composer.php");
include_once("../../helpers/ComposerSourceDb.php");
include_once("../../models/GlobalFetchers.php");
include_once("../models/fetchers.php");

$GHtml      = new CGHtml;
$CLFetchers = new CLFetchers;
$CFetchers  = new GlobalFetchers;

$SourceDb   = new Composer;
$SourceDb   = $SourceDb->init(_COMPOSER_TYPE_DB);

$SourceDb->add("srcDbModel",      "MST_MODEL");

$Db = new oracleDb;
$Db->init($_SESSION["ORCL"],
          $_SESSION["OPASS"],
          $_SESSION["SID"],
          _NO_COMMENT);

if($Db->connect()){

  $CFetchers->fetchModelId($Db,
                           $_POST["modelName"],
                           $SourceDb->getValue("srcDbModel"),
                           $modelId);

  echo  $modelId;

  $Db->dc();
}else{

  echo _CONN_ERROR;
}

?>